package com.fiona.core.message.enums;


public enum SerializationTypeEnum {

    KYRO((byte) 0x01, "kyro"),
    PROTOSTUFF((byte) 0x02, "protostuff");;

    private final byte code;
    private final String name;
    
    SerializationTypeEnum(byte code, String name) {
		this.code = code;
		this.name = name;
	}

    public static String getName(byte code) {
        for (SerializationTypeEnum c : SerializationTypeEnum.values()) {
            if (c.getCode() == code) {
                return c.name;
            }
        }
        return null;
    }

	public byte getCode() {
		return code;
	}

	public String getName() {
		return name;
	}
    
    

}
